<template>
    <div class="w-full h-full flex flex-col">
        <div class="w-full flex flex-row justify-between">
            <div class="flex flex-row   w-w1/5">
                <el-input placeholder="请输入内容" clearable prefix-icon="el-icon-search" v-model="s_company.str_key"
                    @clear="action_list_company">
                </el-input>
                <el-button type="primary" class=" bg-cmain_hover ml-w10" @click="action_list_company">搜索</el-button>
            </div>
            <el-button type="primary" class=" bg-cmain_hover ml-w10" icon="el-icon-plus"
                @click="dialog_add_company = true">添加公司</el-button>
        </div>
        <div class="w-full h-full mt-w20 ">
            <el-table :data="s_company.list_company" stripe height="94%" style="width: 100%; ">
                <el-table-column type="index" label="序号" min-width="10%">
                </el-table-column>
                <el-table-column prop="name" label="公司名称" min-width="20%">
                </el-table-column>
                <el-table-column label="获得报告方式" min-width="10%">
                    <template slot-scope="scope">
                        <span>{{ scope.row.show == 1 ? '直接显示' : '发送邮件' }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="测评次数" min-width="10%">
                    <template slot-scope="scope">
                        <span>{{ scope.row.assess_num == 0 ? '不限制'
                            : scope.row.assess_num + '次'
                        }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="状态" min-width="10%">
                    <template slot-scope="scope">
                        <span :class="scope.row.status == 1 ? ' text-caux' : ' text-c9'">{{ scope.row.status == 1 ? '正常'
                            : '冻结'
                        }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="操作" min-width="20%">
                    <template slot-scope="scope">
                        <el-button size="mini" @click="action_company_staff(scope.row)" v-if="scope.row.status == 1">
                            员工管理</el-button>
                        <el-button class=" bg-caux" type="primary" size="mini" @click="action_edit_company(scope.row)">
                            编辑</el-button>
                        <el-button size="mini" type="warning" @click="action_frozen(scope.row)"
                            style="background-color:#E6A23C" v-if="scope.row.status == 1">冻结
                        </el-button>
                        <el-button size="mini" type="info" @click="action_frozen(scope.row)"
                            style="background-color:#909399" v-else>解冻
                        </el-button>
                        <el-button v-if="scope.row.status != 1" size="mini" type="danger" @click="action_del(scope.row)"
                            style="background-color:#F56C6C">删除
                        </el-button>
                        <el-button size="mini" @click="dialog_report_cover = true; s_company.m_company.id = scope.row.id"
                            v-if="scope.row.status == 1">
                            编辑报告</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <div class="w-full flex items-end justify-center" style="height:7%">
                <el-pagination background layout="prev, pager, next" :total="s_company.m_page.total"
                    :page-size="s_company.m_page.limit" @current-change="action_page_change">
                </el-pagination>
            </div>
        </div>
        <UiDialogAddCompany :data="s_company.m_company" :is_showDialog="dialog_add_company"
            @nydialog_closed="dialog_add_company = false" @nydialog_submit="action_add_company">
        </UiDialogAddCompany>
        <UiDialogCompanyCover :data="s_company.m_company.id" :is_showDialog="dialog_report_cover"
            @nydialog_closed="dialog_report_cover = false"></UiDialogCompanyCover>
    </div>
</template>

<script src="./Index.ts"></script>
<style src="./Index.less" lang="less" scoped></style>
